package tests;

import static org.junit.Assert.*;

import org.junit.Test;

import src.MyBinarySearch;

public class MyBinarySearchTest {

	@Test
	public void testBinarySearch() {

		MyBinarySearch bs = new MyBinarySearch();

		int a = bs.binarySearch(new int[] { 1, 2, 3 }, 2);
		assertEquals(a, 1);

		System.out.println("a: " + a);

		int b = bs.binarySearch(new int[] { 1, 1, 3 }, 2);
		assertEquals(b, -1);

		System.out.println("b: " + b);

	}

	@Test
	public void testBinarySearch2() {

		MyBinarySearch bs = new MyBinarySearch();

		int c = bs.binarySearch(new int[] { 1, 1, 2, 2, 3 }, 2);
		assertEquals(c, 2);

		System.out.println("c: " + c);
	}

}
